# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSConfig.V1.Model.PatchJobInstanceDetailsSummary do
  @moduledoc """
  A summary of the current patch state across all instances that this patch job affects. Contains counts of instances in different states. These states map to `InstancePatchState`. List patch job instance details to see the specific states of each instance.

  ## Attributes

  *   `ackedInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that have acked and will start shortly.
  *   `applyingPatchesInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that are applying patches.
  *   `downloadingPatchesInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that are downloading patches.
  *   `failedInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that failed.
  *   `inactiveInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that are inactive.
  *   `noAgentDetectedInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that do not appear to be running the agent. Check to ensure that the agent is installed, running, and able to communicate with the service.
  *   `notifiedInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances notified about patch job.
  *   `pendingInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances pending patch job.
  *   `postPatchStepInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that are running the post-patch step.
  *   `prePatchStepInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that are running the pre-patch step.
  *   `rebootingInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances rebooting.
  *   `startedInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that have started.
  *   `succeededInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that have completed successfully.
  *   `succeededRebootRequiredInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that require reboot.
  *   `timedOutInstanceCount` (*type:* `String.t`, *default:* `nil`) - Number of instances that exceeded the time out while applying the patch.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ackedInstanceCount => String.t() | nil,
          :applyingPatchesInstanceCount => String.t() | nil,
          :downloadingPatchesInstanceCount => String.t() | nil,
          :failedInstanceCount => String.t() | nil,
          :inactiveInstanceCount => String.t() | nil,
          :noAgentDetectedInstanceCount => String.t() | nil,
          :notifiedInstanceCount => String.t() | nil,
          :pendingInstanceCount => String.t() | nil,
          :postPatchStepInstanceCount => String.t() | nil,
          :prePatchStepInstanceCount => String.t() | nil,
          :rebootingInstanceCount => String.t() | nil,
          :startedInstanceCount => String.t() | nil,
          :succeededInstanceCount => String.t() | nil,
          :succeededRebootRequiredInstanceCount => String.t() | nil,
          :timedOutInstanceCount => String.t() | nil
        }

  field(:ackedInstanceCount)
  field(:applyingPatchesInstanceCount)
  field(:downloadingPatchesInstanceCount)
  field(:failedInstanceCount)
  field(:inactiveInstanceCount)
  field(:noAgentDetectedInstanceCount)
  field(:notifiedInstanceCount)
  field(:pendingInstanceCount)
  field(:postPatchStepInstanceCount)
  field(:prePatchStepInstanceCount)
  field(:rebootingInstanceCount)
  field(:startedInstanceCount)
  field(:succeededInstanceCount)
  field(:succeededRebootRequiredInstanceCount)
  field(:timedOutInstanceCount)
end

defimpl Poison.Decoder, for: GoogleApi.OSConfig.V1.Model.PatchJobInstanceDetailsSummary do
  def decode(value, options) do
    GoogleApi.OSConfig.V1.Model.PatchJobInstanceDetailsSummary.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OSConfig.V1.Model.PatchJobInstanceDetailsSummary do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
